package com.dhcy.mqtt.model.constant;

import java.util.HashMap;
import java.util.Map;

public class MqttConstant {

    /******* 设备类型常量开始 *********************************************/

    /**
     * 01:氚 02:气溶胶 03:中子 04:伽马
     */
    public static final String MQTT_EQUIPMENT_TRITIUM_CODE = "01";
    public static final String MQTT_EQUIPMENT_TRITIUM_NAME = "氚";

    /**
     * 01:氚 02:气溶胶 03:中子 04:伽马
     */
    public static final String MQTT_EQUIPMENT_AEROSOL_CODE = "02";
    public static final String MQTT_EQUIPMENT_AEROSOL_NAME = "气溶胶";

    /**
     * 01:氚 02:气溶胶 03:中子 04:伽马
     */
    public static final String MQTT_EQUIPMENT_NEUTRON_CODE = "03";
    public static final String MQTT_EQUIPMENT_NEUTRON_NAME = "中子";

    /**
     * 01:氚 02:气溶胶 03:中子 04:伽马
     */
    public static final String MQTT_EQUIPMENT_GAMMA_CODE = "04";
    public static final String MQTT_EQUIPMENT_GAMMA_NAME = "伽马";

    public static Map<String, String> equipment_map = new HashMap<String, String>();

    static {
        equipment_map.put(MQTT_EQUIPMENT_TRITIUM_CODE, MQTT_EQUIPMENT_TRITIUM_NAME);
        equipment_map.put(MQTT_EQUIPMENT_AEROSOL_CODE, MQTT_EQUIPMENT_AEROSOL_NAME);
        equipment_map.put(MQTT_EQUIPMENT_NEUTRON_CODE, MQTT_EQUIPMENT_NEUTRON_NAME);
        equipment_map.put(MQTT_EQUIPMENT_GAMMA_CODE, MQTT_EQUIPMENT_GAMMA_NAME);
    }

    public static Map<String, String> getMqtt_equipment_map() {
        return equipment_map;
    }

    public static String getMqttEquipmentName(String key) {
        return equipment_map.get(key);
    }

    /******* 设备类型常量结束 *********************************************/


    /******* 设备状态常量开始 *********************************************/

    /**
     * 氚,中子,伽马 --> 01:正常 02超阈值;
     */
    public static final String MQTT_EQUIPMENT_STATUS_NORMAL_CODE = "01";
    public static final String MQTT_EQUIPMENT_STATUS_NORMAL_VALUE = "正常";

    /**
     * 氚,中子,伽马 --> 01:正常 02超阈值;
     */
    public static final String MQTT_EQUIPMENT_STATUS_SUPTHRESHOLD_CODE = "02";
    public static final String MQTT_EQUIPMENT_STATUS_SUPTHRESHOLD_VALUE = "超阈值";


    /**
     * 气溶胶 --> 01:测量中 02:空闲 03:纸少于10% 04:缺纸 05:超阈值
     */
    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_MEASUREMENT_CODE = "01";
    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_MEASUREMENT_VALUE = "测量中";

    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_IDLE_CODE = "02";
    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_IDLE_VALUE = "空闲";

    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_LESSPAPER_CODE = "03";
    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_LESSPAPER_VALUE = "纸少于10%";

    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_NOPAPER_CODE = "04";
    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_NOPAPER_VALUE = "缺纸";

    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_SUPTHRESHOLD_CODE = "05";
    public static final String MQTT_EQUIPMENT_AEROSOL_STATUS_SUPTHRESHOLD_VALUE = "超阈值";

    public static Map<String, String> equipment_status_map = new HashMap<String, String>();
    public static Map<String, String> equipment_aerosol_status_map = new HashMap<String, String>();

    static {
        equipment_status_map.put(MQTT_EQUIPMENT_STATUS_NORMAL_CODE, MQTT_EQUIPMENT_STATUS_NORMAL_VALUE);
        equipment_status_map.put(MQTT_EQUIPMENT_STATUS_SUPTHRESHOLD_CODE, MQTT_EQUIPMENT_STATUS_SUPTHRESHOLD_VALUE);

        equipment_aerosol_status_map.put(MQTT_EQUIPMENT_AEROSOL_STATUS_MEASUREMENT_CODE, MQTT_EQUIPMENT_AEROSOL_STATUS_MEASUREMENT_VALUE);
        equipment_aerosol_status_map.put(MQTT_EQUIPMENT_AEROSOL_STATUS_IDLE_CODE, MQTT_EQUIPMENT_AEROSOL_STATUS_IDLE_VALUE);
        equipment_aerosol_status_map.put(MQTT_EQUIPMENT_AEROSOL_STATUS_LESSPAPER_CODE, MQTT_EQUIPMENT_AEROSOL_STATUS_LESSPAPER_VALUE);
        equipment_aerosol_status_map.put(MQTT_EQUIPMENT_AEROSOL_STATUS_NOPAPER_CODE, MQTT_EQUIPMENT_AEROSOL_STATUS_NOPAPER_VALUE);
        equipment_aerosol_status_map.put(MQTT_EQUIPMENT_AEROSOL_STATUS_SUPTHRESHOLD_CODE, MQTT_EQUIPMENT_AEROSOL_STATUS_SUPTHRESHOLD_VALUE);
    }

    public static Map<String, String> getMqtt_equipment_status_map() {
        return equipment_status_map;
    }

    public static String getMqttEquipmentStatusValue(String key) {
        return equipment_status_map.get(key);
    }

    public static Map<String, String> getMqtt_equipment_aerosol_status_map() {
        return equipment_aerosol_status_map;
    }

    public static String getMqttEquipmentAerosolStatusValue(String key) {
        return equipment_aerosol_status_map.get(key);
    }

    /******* 设备状态常量结束 *********************************************/

}
